#ifndef WIDGET_H
#define WIDGET_H

#include "servicemanagement.h"
#include "dishesmanagement.h"
#include "ordersmanagement.h"
#include "tablemanagement.h"
#include "discountmanagement.h"
#include "checkoutmanagement.h"
#include "turnovermanagement.h"
#include "commentmanagement.h"
#include <QWidget>
#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QTcpServer>
#include <QTcpSocket>
#include <QMessageBox>
#include <QDebug>
#include <QSqlError>
#include <QPushButton>
#include <QStringList>
#include <QStringList>
#include <QDateTime>
#include <QDate>


namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    ~Widget();


private slots:
    void on_dishesManagementBtn_clicked();

    void on_serviceManagementBtn_clicked();

    void sendText(QString);

    void on_orderManagementBtn_clicked();

    void on_tableManagementBtn_clicked();

    void on_discountManagementBtn_clicked();

    void on_checkoutManagementBtn_clicked();

    void on_turnoverManagementBtn_clicked();

    void on_commentManagementBtn_clicked();

private:
    Ui::Widget *ui;
    QSqlDatabase db;
    QTcpServer* mServer;//服务器端
    QTcpSocket* mSocket;//通信套接字
    serviceManagement* service;
    dishesManagement* dishes;
    ordersManagement* orders;
    tableManagement* table;
    discountManagement* discount;
    checkoutManagement* checkout;
    turnoverManagement* turnover;
    commentManagement* comment;
    void login(QString message);
    void signup(QString message);
    void sendDishes();
    void getOrder(QString message);
    void sendFinishedOrder(QString customer);
    void updateComment(QString message);
    void chatGet(QString comment);
    void sendComment(QString message);
};

#endif // WIDGET_H
